Skip to content

Fix dropped positional argument for packages with multiple bins#21

Open
lazerg wants to merge 1 commit into
laravel:1.xfrom
lazerg:fix/issue-15-positional-arg-precedence
Open

Fix dropped positional argument for packages with multiple bins#21
lazerg wants to merge 1 commit into
laravel:1.xfrom
lazerg:fix/issue-15-positional-arg-precedence

Conversation

@lazerg

@lazerg lazerg commented Jun 30, 2026

Copy link
Copy Markdown

For packages with more than one bin, the first positional argument was always dropped because $console->arguments[0] ?? null === $possibleCommand is parsed as $console->arguments[0] ?? (null === $possibleCommand) (=== binds tighter than ??), so the guard unset the argument whenever one was present. Wrapping the ?? null in parentheses fixes it. For example, cpx brianium/paratest tests/Sub now runs just tests/Sub instead of the whole suite.

Fixes #15

@lazerg

lazerg commented Jul 1, 2026

Copy link
Copy Markdown
Author

@joetannenbaum this one's ready whenever you get a chance — 1.x fix for the arg-parsing bug in #15.

@joetannenbaum

Copy link
Copy Markdown
Collaborator

Thanks for the PR! Right now we're focusing entirely on v2.x, so I'm going to hold off on this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants